/*
 * acm1938.c
 *
 *  Created on: 28 Mar 2010
 *      Author: xuxu
 */

#include<stdio.h>

double combin(int n,int c)
{
	double result;
	int i;
	if(c>n/2)
		c=n-c;
	result=1;
	for(i=1;i<=c;i++)
		result*=(double)(n-c+i)/(double)i;
	return result;
}

int main()
{
	int n,m;
	double result;
	while(scanf("%d%d",&n,&m))
	{
		if(0==n&&0==m)
			break;
		if(0==m)
			result=1;
		else
			result=combin(n,m);
		printf("%.0lf\n",result);
	}
	return 0;
}
